import React, { FC } from "react";

interface ReceiveProps {
  data: {
    title: number;
    a: number;
  };
}
/** 当state 发生变化则，子组件会自动刷新（无论怎么解析）(当值为普通的函数的时候不会触发重新渲染。) */
const ReceivePropsC: FC<ReceiveProps> = (props) => {
  const { data } = props;
  const { title, a } = data ?? {};
  return (
    <div>
      <span style={{ color: "skyblue" }}>{a}</span>
      <span style={{ color: "purple" }}>{title}</span>
    </div>
  );
};

export default ReceivePropsC;
